﻿#include"stdafx.h"
#ifdef LK_
namespace LK
{
	/**
	@brief 生成double无穷大*/
	double MaxValues::MakeDoubleInfinite(){
		return 1e308*1e308;
	}
	/**
	@brief 生成long double无穷大*/
	long double MaxValues::MakeLongDoubleInfinite(){
		return 1e308*1e308;
	}
	/**
	@brief 生成float无穷大*/
	float MaxValues::MakeFloatInfinite() {
		return (float)1e300;
	}
	/**
	@brief 生成double最大值*/
	double MaxValues::MakeDouble()
	{
		double d = 1;
		while (d - 1 != d)d = d * 2;
		d -= 2;
		while (d * 4 != d * 2)d *= 2;
		return d;
	}
	/**
	@brief 生成float最大值*/
	float MaxValues::MakeFloat()
	{
		float d = 1;
		while (d - 1 != d)d = d * 2;
		d -= 2;
		while (d * 4 != d * 2)d *= 2;
		return d;
	}
	/**
	@brief 生成long double最大值*/
	long double MaxValues::MakeLongDouble(){
			long double d=1;
			while (d - 1 != d)d = d * 2;
			d -= 2;
			while (d * 4 != d * 2)d *= 2;
			return d;
	}
	/**
	@brief 生成double绝对值最小值*/
	double MinValues::MakeDoubleAbs(){
		double d = 1;
		while (d*0.5 != 0)d *= 0.5;
		return d;
	}
	/**
	@brief 生成float绝对值最小值*/
	float MinValues::MakeFloatAbs(){
		float d = 1;
		while (d*0.5 != 0)d *= 0.5;
		return d;
	}
	/**
	@brief 生成long double绝对值最小值*/
	long double MinValues::MakeLongDoubleAbs(){
		long double d = 1;
		while (d*0.5 != 0)d *= 0.5;
		return d;
	}

	const float MaxValues::Float = MaxValues::MakeFloat();
	const double MaxValues::Double = MaxValues::MakeDouble();
	const float MaxValues::FloatInfinite = MaxValues::MakeFloatInfinite();
	const float MaxValues::FloatAbs = MaxValues::MakeFloat();
	const double MaxValues::DoubleAbs = MaxValues::MakeDouble();
	const double MaxValues::DoubleInfinite = MaxValues::MakeDoubleInfinite();
	const long double MaxValues::LongDouble = MaxValues::MakeLongDouble();
	const long double MaxValues::LongDoubleInfinite = MaxValues::MakeLongDoubleInfinite();
	const float MinValues::Float = -MaxValues::MakeFloat();
	const double MinValues::Double = -MaxValues::MakeDouble();
	const float MinValues::FloatAbs = MinValues::MakeFloatAbs();
	const double MinValues::DoubleAbs = MinValues::MakeDoubleAbs();
	const long double MinValues::LongDouble = -MaxValues::MakeLongDouble();
	const long double MinValues::LongDoubleAbs = MinValues::MakeLongDoubleAbs();
	const float MinValues::FloatInfinite = -MaxValues::MakeFloatInfinite();
	const double MinValues::DoubleInfinite = -MaxValues::MakeDoubleInfinite();
	const long double MinValues::LongDoubleInfinite = -MaxValues::MakeLongDoubleInfinite();

}
#endif